import { IsEmail, IsString, MinLength, MaxLength, IsOptional } from 'class-validator';

/**
 * 注册 DTO
 */
export class RegisterDto {
  @IsEmail({}, { message: '请输入有效的邮箱地址' })
  email: string;

  @IsString()
  @MinLength(6, { message: '密码至少需要6个字符' })
  @MaxLength(20, { message: '密码最多20个字符' })
  password: string;

  @IsString()
  @IsOptional()
  @MaxLength(50, { message: '昵称最多50个字符' })
  nickname?: string;
}






